package com.qzimp.fujiancuo.mapper;

import com.qzimp.fujiancuo.entity.Culture;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CultureMapper {

    @Select("SELECT * FROM tb_culture WHERE temple_id = #{templeId}")
    List<Culture> findByTempleId(Long templeId);

    @Insert("INSERT INTO tb_culture(temple_id, culture_name, description) VALUES(#{templeId}, #{cultureName}, #{description})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void insert(Culture culture);

    @Update("UPDATE tb_culture SET culture_name = #{cultureName}, description = #{description} WHERE id = #{id}")
    void update(Culture culture);

    @Delete("DELETE FROM tb_culture WHERE id = #{id}")
    void delete(Long id);
}
